package org.example.afiona.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: leo
 * @date: 2021/6/9
 */
@Configuration
public class RestTemplateConfiguration {
    @Bean
    @LoadBalanced//如果注释掉这个注解，则不能通过服务名称来调用
    //引入eureka客户端的时候就已经自带了ribbon
    public RestTemplate getRestTemplate(){
        return  new RestTemplate();
    }
}
